package debtbundler.domain.entity;

/**
 * Transaction of money from one <code>MoneyPool</code> to another.
 * <p>
 * A transaction must be added to the <code>MoneyPool</code>s in order
 * to be accounted for.
 * 
 * @see MoneyPool
 * @author Anssi
 *
 */
public interface Transaction extends Entity, Valuable {
	/**
	 * Returns the value of this transaction. The value of a
	 * transaction is always greater than or equal to zero.  
	 * 
	 * @param value	
	 * 	the value of this transaction
	 */
	@Override
	public double getValue();	
	
	/**
	 * Returns the value of this transaction. The value must be
	 * greater than or equal to zero.  
	 * 
	 * @param value	
	 * 	the value of this transaction
	 * @throws IllegalArgumentException
	 * 	if <code>value</code> is negative
	 */
	public void setValue(double value) throws IllegalArgumentException;	
	
	/**
	 * Returns the pool from which money is transferred. 
	 * 
	 * @return
	 * 	the pool from which money is transferred
	 */
	public MoneyPool getFromPool();
	
	/**
	 * Returns the pool to which money is transferred. 
	 * 
	 * @return
	 * 	the pool to which money is transferred
	 */
	public MoneyPool getToPool();	

}